package com.woniuxy.service.impl;

import com.woniuxy.entity.Usermannge;
import com.woniuxy.dao.UsermanngeDao;
import com.woniuxy.service.UsermanngeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Usermannge)表服务实现类
 *
 * @author makejava
 * @since 2021-05-15 14:52:41
 */
@Service("usermanngeService")
public class UsermanngeServiceImpl implements UsermanngeService {
    @Resource
    private UsermanngeDao usermanngeDao;

    /**
     * 通过ID查询单条数据
     *
     * @param customerId 主键
     * @return 实例对象
     */
    @Override
    public Usermannge queryById(Integer customerId) {
        return this.usermanngeDao.queryById(customerId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<Usermannge> queryAllByLimit(int offset, int limit) {
        return this.usermanngeDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param usermannge 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(Usermannge usermannge) {

        return this.usermanngeDao.insert(usermannge);
    }

    /**
     * 修改数据
     *
     * @param usermannge 实例对象
     * @return 实例对象
     */
    @Override
    public int update(Usermannge usermannge) {

        return  this.usermanngeDao.update(usermannge);
    }

    /**
     * 通过主键删除数据
     *
     * @param customerId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer customerId) {
        return this.usermanngeDao.deleteById(customerId) > 0;
    }


    /**
     * Description : 获取usermanager所有数据  <br/>
     * ChangeLog : 1. 创建 ( 17:30 [Hello Mr. Guo]);
     *
     * @return java.util.List<com.woniuxy.entity.Usermannge>
    */

    @Override
    public List<Usermannge> queryAll() {
        List<Usermannge> usermannges = this.usermanngeDao.queryAllS();
        return usermannges;
    }

    /**
     * Auther: Hello Mr. Guo  <br/>
     * Date: 19:54:  <br/>
     * Description:模糊查询
     */

    @Override
    public List<Usermannge> search(Usermannge usermannge) {
        List<Usermannge> usermannges = this.usermanngeDao.queryAll(usermannge);
        return usermannges;
    }

}
